package com.zhidisoft.crm.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import com.zhidisoft.crm.entity.SysUserRole;

public interface ISysUserRolemapper {
	/**
	 * 添加用户角色
	 * @param sur
	 */
	@Insert("insert into sys_user_role(id,user_id,role_id) values(#{id},#{user_id},#{role_id})")
	void save(SysUserRole sur);
	
	/**
	 * 根据role_id删除用户角色
	 * @param id
	 */
	@Delete("delete from sys_user_role where user_id=#{user_id}")
	void deleteById(String user_id);

	
	@Select("select role_id from sys_user_role where user_id=#{user_id}")
	String findRoleId(String user_id);
	
}
